home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
3D Images
/
3D Images.iso
/
programs
/
amiga
/
hdanim
/
hdanim.doc
< prev
next >
Wrap
Text File
|
1995-01-12
|
7KB
|
127 lines
---------------------
HDANIM
© 1992 By F.Pretorius
---------------------
HDAnim is an animation player designed to play IFF ANIM Opcode 5
animations directly from a hard disk, thus allowing "larger than memory"
animations to be seen. The program is quite small and easy to use, and can be
run from the shell (CLI) or workbench. From the shell, the syntax is as
follows:
HDAnim <anim file name> [initial delay] [-lno] <press Return>
The anim file name is the name and path of the animation to be loaded,
which is not required to be on a hard drive.
The optional initial delay is a number between 0 and 60 determining how
fast the animation should play. The number is the delay in jiffies (1/60th of
a sec) between each frame. Depending on various factors, the selected speed
may not be achievable. These factors are discussed in more detail below.
The three optional flags l,n and o stand for loop, nopause and once
respectively.
Use the loop flag when playing animations designed to repeat in an
"infinite" loop. Such animations are created in a special way. The first two
frames equal the last two of the animation. This allows the player programs
to skip the first two frames when repeating the animation, providing somewhat
faster play than starting from scratch. Certain programs such as DeluxePaint
III and IV automatically save animations in such a way. To find out if an
animation was created to loop, play it with loop mode on and watch it repeat.
If some of the screen becomes "trashed" (not harmful), the animation was not
meant to loop.
HDAnim will pause for one second at the beginning and end of each run of
the animation (loop mode technically doesn't have an end). To suppress this
pause use the nopause flag.
To play the animation only once, use the once flag.
As an example, to play a looping animation named 'fly' once at 15 frames
per second you would use the following line:
HDAnim fly 4 -lo <press Return>
To calculate frames per second, divide 60 by the delay.
If you run HDAnim without arguments or use ? for the filename, help text
will print.
There are two methods to load an animation from Workbench. One is to
click on the HDAnim icon while holding down a shift key, then double-click
the desired anim file's icon to load. For the other method, select the anim
file's icon, then select "Info" under the Workbench menu, or "Information"
under Kickstart 2 from the Icons menu. This will pop up a requester with
information about the icon. In the string gadget labeled "Default Tools",
type the path and name of the HDAnim program. For example, if you have copied
the program to a directory called ANIMS on drive dh0: , you would type:
dh0:anims/HDAnim
... as the default tool. Click on the save gadget. From then on, to load the
animation double-click its icon.
You can also pass HDAnim arguments through Workbench by adding a new
Tool Type in the icon information requester for each argument. In the Tool
Type string gadget, type in the delay or one of the following keywords: LOOP,
ONCE and NOPAUSE, representing the flags discussed earlier. For an example
look at the information of the demo animation's icon.
Once the animation has loaded, the ESC key or left mouse button can be
used to quit. The P key pauses the animation, and you can single-step through
the frames with the space bar. The function keys will modify the delay
between frames as follows:
F1 - 0 (as fast as possible)
F2 - 1 (60fps)
F3 - 2 (30fps)
F4 - 3 (20fps)
F5 - 4 (15fps)
F6 - 5 (12fps)
F7 - 6 (10fps)
F8 - 12 (5fps)
F9 - 20 (3fps)
F10- 60 (1fps)
FACTORS AFFECTING PLAYBACK SPEED
The most important factors affecting playback speed are screen
resolution and depth, how much the picture changes between each frame of the
animation, and how fast and full the hard disk is.
Generally, the higher the resolution and greater the depth, that is,
more colors, the slower the animation will run. Also be aware that in 5 and 6
bitplane lo-res (32 color, HALFBRITE and HAM), and 3 and 4 bitplane hi-res (8
and 16 color) the CPU has to wait a bit when accessing CHIP ram, of which
HDAnim uses much for the screens. In 5 bitplane lo-res the wait is not very
long. In 6 bitplane lo-res and 3 bitplane hi-res, the wait is a bit more. In
4 bitplane hi-res the wait is quite significant.
Due to the compression scheme used by the ANIM format, if much change
takes place between two frames, the time required to decompress from one
frame to the next will be longer than if there was relatively little change.
Also, the more change the larger the resulting file, and so hard disk speed
becomes more of a factor.
Of course, the faster your hard disk, the less time spent on loading
each frame, so your animation will play that bit faster. Perhaps a more
important factor than the speed of the drive is how full or cluttered with
files the drive is. Through continued use of the drive; adding a file here
and deleting one there, the free blocks are eventually scattered throughout
the drive. If you then create an animation spanning several of these blocks,
quite a bit of time will be spent seeking from one block to another when
playing back the animation. If your drive is relatively empty, this will not
be much of a problem, but with a nearly full drive the animation could slow
down and not play as smoothly. One solution to this problem is when initially
formatting the drive, create a small partition for animations, then every now
and then copy the animations to another partition, re-initialize the
animation partition, then copy the files back. They will then be copied back
into continuous blocks. Another possible solution is to obtain one of the PD
or commercial programs available which re-organize and optimize the disk
structure.
On a 25Mhz 3000 with a 90 percent full 50Meg hard drive, I was able to
get speeds on average of about 10-15 fps on a 320 by 200 , 32 color Scenery
Animator animation with full detail and clouds. On a stock 2000 with a 10
percent full 40Meg drive, the same animations played at around 6-8 fps. For
fun I also tried a 736-by-480 hi-res, 16 color animation on the 3000 and
could only get about 4 fps. Of course, without clouds the animations run
quite a bit faster.
MEMORY CONSIDERATIONS
As a rough guess of how much memory HDAnim will use, multiply the memory
required by a single screen of the same resolution and depth as the animation
by 3. A screen requires (Width*Height*Depth)/8 bytes of memory. For example,
a 320 by 200, 5 bitplane lo-res screen requires (320*200*5)/8 = 40000 bytes
or 40 k of memory. Therefore, HDanim will use about 120K total RAM, of which
two thirds must be Chip RAM (for a double-buffered screen) and the remaining
third can be in Chip or Fast RAM.
END OF TEXT